<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>waf admin</title>

	<link href="/css/bootstrap.min.css" rel="stylesheet">
	<link href="/css/datepicker3.css" rel="stylesheet">
	<link href="/css/bootstrap-table.css" rel="stylesheet">
	<link href="/css/styles.css" rel="stylesheet">

	<!--Icons-->
	<script src="/js/lumino.glyphs.js"></script>

	<!--[if lt IE 9]>
	<script src="/js/html5shiv.js"></script>
	<script src="/js/respond.min.js"></script>
	<![endif]-->

</head>

<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
	<div class="container-fluid">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#sidebar-collapse">
				<span class="sr-only">Toggle navigation</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="#"><span>xsec waf</span>Admin</a>
			<ul class="user-menu">
				<li class="dropdown pull-right">
					<a href="#" class="dropdown-toggle" data-toggle="dropdown"><svg class="glyph stroked male-user"><use xlink:href="#stroked-male-user"></use></svg> User <span class="caret"></span></a>
					<ul class="dropdown-menu" role="menu">
						<li><a href="/admin/user/"><svg class="glyph stroked gear"><use xlink:href="#stroked-gear"></use></svg> Settings</a></li>
						<li><a href="/admin/logout/"><svg class="glyph stroked cancel"><use xlink:href="#stroked-cancel"></use></svg> Logout</a></li>
					</ul>
				</li>
			</ul>
		</div>

	</div><!-- /.container-fluid -->
</nav>

<div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar">
	<form role="search">
		<div class="form-group">
			<input type="text" class="form-control" placeholder="Search">
		</div>
	</form>
	<ul class="nav menu">
		<li class="active"><a href="/admin/index/"><svg class="glyph stroked gear"><use xlink:href="#stroked-gear"/></svg> Index</a></li>
		<li><a href="/admin/user/"><svg class="glyph stroked male user "><use xlink:href="#stroked-male-user"/></svg> Users</a></li>
		<li><a href="/admin/site/"><svg class="glyph stroked desktop"><use xlink:href="#stroked-desktop"/></svg> Site Manager</a></li>
		<li><a href="/admin/rule/"><svg class="glyph stroked lock"><use xlink:href="#stroked-lock"/></svg> WAF rules</a></li>
		<li role="presentation" class="divider"></li>
	</ul>

</div><!--/.sidebar-->
<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
	<div class="row">
		<ol class="breadcrumb">
			<li><a href="#"><svg class="glyph stroked home"><use xlink:href="#stroked-home"></use></svg></a></li>
			<li class="active">Site</li>
		</ol>
	</div><!--/.row-->
	<div class="row">
		<div class="col-lg-12">
			<h1 class="page-header">Site List</h1>
		</div>
	</div><!--/.row-->

	<div class="row">
		<div class="col-lg-12">
			<div class="panel">
				<div class="panel-heading">
					<a href="/admin/site/new/" class="btn btn-large btn-primary btn-block">新增后端站点</a>
				</div>
				<h2>{{.Flash.SuccessMsg}}</h2>
				<div class="panel-body">
					<table  align="center" class="table table-hover table-bordered">
						<thead>
						<tr align="center">
							<th>ID</th>
							<th>Site Name</th>
							<th>Port</th>
							<th>Backend</th>
							<th>Clone-Site</th>
							<th>SSL Status</th>
							<th>Debug Level</th>
							<th>Update Time</th>
							<th>Update Times</th>
							<th colspan="3">管理</th>
						</tr>
						{{range .sites}}
						<tr>
							<td>{{.Id}}</td>
							<td>{{.SiteName}}</td>
							<td>{{.Port}}</td>
							<td>{{.BackendAddr}}</td>
                            <td>{{.UnrealAddr}}</td>
							<td>{{.Ssl}}</td>
							<td>{{.DebugLevel}}</td>
							<td>{{.LastChange}}</td>
							<td>{{.Version}}</td>
							<td><a href="/admin/site/edit/{{.Id}}">edit</a></td>
							<td><a href="/admin/site/del/{{.Id}}">del</a></td>
							<td><a href="/admin/site/sync/{{.Id}}">sync</a></td>
						</tr>
						{{end}}
						</thead>
					</table>
					<div class="panel-heading">
						<a href="/admin/site/sync/" class="btn btn-large btn-primary btn-block">同步全部后端配置</a>
					</div>
				</div>
			</div>
		</div>

</div><!--/.main-->

<script src="/js/jquery-1.11.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/chart.min.js"></script>
<script src="/js/chart-data.js"></script>
<script src="/js/easypiechart.js"></script>
<script src="/js/easypiechart-data.js"></script>
<script src="/js/bootstrap-datepicker.js"></script>
<script src="/js/bootstrap-table.js"></script>
<script>
		!function ($) {
			$(document).on("click","ul.nav li.parent > a > span.icon", function(){
				$(this).find('em:first').toggleClass("glyphicon-minus");
			});
			$(".sidebar span.icon").find('em:first').addClass("glyphicon-plus");
		}(window.jQuery);

		$(window).on('resize', function () {
		  if ($(window).width() > 768) $('#sidebar-collapse').collapse('show')
		})
		$(window).on('resize', function () {
		  if ($(window).width() <= 767) $('#sidebar-collapse').collapse('hide')
		})
	</script>
</div>
</body>

</html>
